package de.hauschild.gmltracer.gml.impl.value.integer;

import de.hauschild.gmltracer.gml.Environment;
import de.hauschild.gmltracer.gml.TokenStack;
import de.hauschild.gmltracer.gml.impl.AbstractToken;
import de.hauschild.gmltracer.gml.impl.value.real.RealToken;

public class ConvertIntegerToRealOperatorToken extends AbstractToken {

  @Override
  public void evaluate(final Environment environment, final TokenStack tokenStack) {
    final IntegerToken value = tokenStack.pop(IntegerToken.class);
    tokenStack.push(new RealToken(value.getValue().doubleValue()));
  }

  @Override
  public String toString() {
    return "real";
  }
}
